'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')
module.exports = {
  dev: {
    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},
    // Various Dev Server settings
    host: '0.0.0.0',// can be overwritten by process.env.HOSTY
    // host: '192.168.1.106', // can be overwritten by process.env.HOST
    port: 8078, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-


    /**
     * Source Maps
     */

    // https://webpack.js.org/configuration/devtool/#development
    devtool: 'cheap-module-eval-source-map',

    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,

    cssSourceMap: true
  },

  build: {
    // 首页输出地址
    index: path.resolve(__dirname, '../dist/index.html'),
    // 打包后的文件输出地址
    assetsRoot: path.resolve(__dirname, '../dist'),
    //静态文件目录名称
    assetsSubDirectory: 'static',
    //静态资源访问地址。需要设定为 '/'
    //否则二级路由跳转加载js时会出现路径错误
    assetsPublicPath: '/',
    /**
     * Source Maps
     */
    //生成环境打包的时候不需要js源码包
    productionSourceMap: false,
    devtool: '#source-map',
    //代码打包成压缩包，浏览器支持自动解压的将会加载压缩包
    //需要先安装依赖 npm install --save-dev compression-webpack-plugin
    productionGzip: true,
    productionGzipExtensions: ['js', 'css'],

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  }
}
